﻿using Firestarter.DB.Schema.BO;
using FireStarterModeller.Test;

namespace Firestarter.DB.Schema.Test.BO.TestUtils
{
    public partial class TestUtilsReverseEngineeringSettings
    {
        /// <summary>
        /// Creates a new saved ReverseEngineeringSettings with a random value assigned to every property
        /// </summary>
        public static ReverseEngineeringSettings CreateSavedReverseEngineeringSettings()
        {
            ReverseEngineeringSettings reverseEngineeringSettings = CreateUnsavedValidReverseEngineeringSettings();
            reverseEngineeringSettings.Save();
            return reverseEngineeringSettings;
        }

        /// <summary>
        /// Creates a new unsaved ReverseEngineeringSettings with a random value assigned to every property
        /// </summary>
        public static ReverseEngineeringSettings CreateUnsavedValidReverseEngineeringSettings()
        {
            ReverseEngineeringSettings reverseEngineeringSettings = new ReverseEngineeringSettings();
            reverseEngineeringSettings.ImportTables = TestUtilsShared.GetRandomBoolean();
            reverseEngineeringSettings.ImportViews = TestUtilsShared.GetRandomBoolean();
            reverseEngineeringSettings.TableNameFilter = TestUtilsShared.GetRandomString();
            reverseEngineeringSettings.ViewNameFilter = TestUtilsShared.GetRandomString();
            return reverseEngineeringSettings;
        }
	    
        /// <summary>
        /// Creates a new unsaved ReverseEngineeringSettings where all properties are null, except ID properties
        /// and those with default values.  If there are compulsory properties without
        /// defaults, saving the object will throw an exception.
        /// </summary>
        public static ReverseEngineeringSettings CreateUnsavedDefaultReverseEngineeringSettings()
        {
            ReverseEngineeringSettings reverseEngineeringSettings = new ReverseEngineeringSettings();
            return reverseEngineeringSettings;
        }
    }
}